x86/pagewalk: Improve the logic behind setting access and dirty bits
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 2 Mar 2017 18:07:33 +0000 (18:07 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 27 Mar 2017 10:49:26 +0000 (11:49 +0100)
commitd9d0dd10794588c7f9a97f21b75916b6fa48630e
tree6d7063bfb147f4a68bb7cc311e31cdd308fee4d4
parentf9964cae8c3ee1c486f14022163e72e2ffd9fe04
x86/pagewalk: Improve the logic behind setting access and dirty bits

The boolean pse2M is misnamed, because it might refer to a 4M superpage.

Switch the logic to be in terms of the level of the leaf entry, and rearrange
the calls to set_ad_bits() to be a fallthrough switch statement, to make it
easier to follow.

Alter set_ad_bits() to take properly typed pointers and booleans rather than
integers.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/guest_walk.c